gdkdisplay-x11: Do not pass a NULL source device to _gdk_display_device_grab_update
authorCarlos Garcia Campos <cgarcia@igalia.com>
Tue, 18 Jun 2013 11:20:10 +0000 (13:20 +0200)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Mon, 16 Sep 2013 10:47:38 +0000 (12:47 +0200)
Pass the master device instead if the last slave is NULL. This is
unlikely to happen in most of the cases, but can happen when running
unit tests where there's no pointer interaction to update the last
slave.

https://bugzilla.gnome.org/show_bug.cgi?id=696756

gdk/x11/gdkdisplay-x11.c

index e1a28ead401880f793a3d58e3de2357d4ec98ef1..347bcce6bdb7dcc36254d86528e82790811bdf9f 100644 (file)
@@ -1737,7 +1737,8 @@ device_grab_update_callback (GdkDisplay *display,
 
   pointer_info = _gdk_display_get_pointer_info (display, device);
   _gdk_display_device_grab_update (display, device,
-                                   pointer_info->last_slave, serial);
+                                   pointer_info->last_slave ? pointer_info->last_slave : device,
+                                   serial);
 }
 
 #define XSERVER_TIME_IS_LATER(time1, time2)                        \